package cn.lytcom.architecture.activity;

import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v7.widget.Toolbar;
import android.view.View;

import javax.inject.Inject;

import cn.lytcom.architecture.MyApplication;
import cn.lytcom.architecture.R;
import cn.lytcom.architecture.fragment.InfoFragment;
import cn.lytcom.architecture.manager.SpManager;
import timber.log.Timber;

/**
 * Created by lytcom on 2017/5/14.
 */

public class InfoActivity extends SliderActivity {

    @Inject
    SpManager spManager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        MyApplication.getAppComponent().inject(this);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                onBackPressed();
            }
        });
        FragmentManager fragmentManager = getSupportFragmentManager();
        fragmentManager.beginTransaction().replace(R.id.content_layout, new InfoFragment()).commit();
        Timber.i(spManager.getEmailUrl());
    }

    @Override
    protected int getContentView() {
        return R.layout.activity_info;
    }
}
